package com.qlk.vorder.dao.impl;

import com.qlk.common.dao.mybatis.BaseDao;
import com.qlk.vorder.dao.OrderNoteDao;
import com.qlk.vorder.domain.OrderNote;
import com.qlk.vorder.domain.query.OrderNoteQuery;

import java.util.List;
import org.springframework.stereotype.Repository;

/**
 * OrderNoteDAO实现类<br/>
 * 对'便签'表进行基本的操作
 * 
 * @author zhaoyanan
 * @version 2016-7-28 14:13:59
 * 
 */
@Repository
public class OrderNoteDaoImpl extends BaseDao implements OrderNoteDao {
	/** namespace */
	private final String namespace = OrderNoteDaoImpl.class.getName();

	/**
	 * {@inheritDoc}
	 */
	public List<OrderNote> queryOrderNoteList(OrderNoteQuery queryBean) {
		return (List<OrderNote>) queryForList(namespace + ".queryOrderNoteList", queryBean);
	}

	/**
	 * {@inheritDoc}
	 */
	public boolean insert(OrderNote orderNote) {
		return insert(namespace + ".insert", orderNote);
	}

	/**
	 * {@inheritDoc}
	 */
	public boolean update(OrderNote orderNote) {
		return update(namespace + ".update", orderNote);
	}

	/**
	 * {@inheritDoc}
	 */
	public int queryOrderNoteCount(OrderNoteQuery queryBean) {
		return (Integer) queryForObject(namespace + ".queryOrderNoteCount", queryBean);
	}

	/**
	 * {@inheritDoc}
	 */
	public List<OrderNote> queryOrderNoteListWithPage(OrderNoteQuery queryBean) {
		return (List<OrderNote>) queryForList(namespace + ".queryOrderNoteListWithPage", queryBean);
	}

	/**
	 * {@inheritDoc}
	 */
	public boolean delete(OrderNote configuration) {
		return delete(namespace + ".delete", configuration);
	}

	/**
	 * {@inheritDoc}
	 */
	public OrderNote getOrderNoteById(Long id) {
		return (OrderNote) queryForObject(namespace + ".getOrderNoteById", id);
	}

	/**
	 * {@inheritDoc}
	 */
	public boolean exist(OrderNote orderNote) {
		int count = (Integer) queryForObject(namespace + ".exist", orderNote);
		return count > 0;
	}
}
